const modules = import.meta.glob("../components/*.vue");
import type { App } from "vue";

export function setupComponents(app: App<Element>) {
  Object.keys(modules).forEach((componentPath) => {
    // 获取遍历的当前组件实例对象
    let curComponent = modules[componentPath];
    const path_arr = curComponent.name.split("/");
    const path: string = path_arr[path_arr.length - 1];
    const name = "my-" + path.replace(".vue", "").toLowerCase();

    console.log("🚀 ~ Object.keys ~ curComponent:", name);
    // app.component(name, curComponent);
  });
}
